<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
    <title>Document</title>
	<link href="https://cdn.bootcdn.net/ajax/libs/quill/1.3.6/quill.snow.css" rel="stylesheet">
	<!-- <link href="https://cdn.bootcdn.net/ajax/libs/highlight.js/10.4.1/styles/monokai-sublime.min.css" rel="stylesheet"> -->
	<link href="https://cdn.bootcdn.net/ajax/libs/highlight.js/10.4.1/styles/vs.min.css" rel="stylesheet">
</head>
<body>	
<div id="editor"></div>
<pre>
var a = 1;
var s = "hello";
</pre>
<button class="draw">draw</button>
<script src="https://cdn.bootcdn.net/ajax/libs/quill/1.3.6/quill.js"></script>
<script src="https://cdn.bootcss.com/highlight.js/9.15.8/highlight.min.js"></script>
<script>
	/*
	highlightjs.org的网址:https://highlightjs.org/static/demo/
	
	*/
	hljs.configure({
		languages: ['javascript', 'java', 'python', 'css', 'html']
	});
	document.getElementsByClassName('draw')[0].onclick=function(){
		document.querySelectorAll('pre').forEach((block) => {
			hljs.highlightBlock(block);
		})
	}
	var quill = new Quill('#editor', {
		theme: 'snow',
		modules: {
      		toolbar: [['code-block']]
    	}
	});
</script>
</body>
</html>
